<?php /* Smarty version Smarty-3.0.8, created on 2015-10-15 10:47:18
         compiled from "/var/www/html/magroup/admin/tpl/url_index.html" */ ?>
<?php /*%%SmartyHeaderCode:255844709561f13b6a92250-21078096%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '59656ecaf277ec3b120d41a63f6eb6ad352e5339' => 
    array (
      0 => '/var/www/html/magroup/admin/tpl/url_index.html',
      1 => 1444876874,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '255844709561f13b6a92250-21078096',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>
<?php if (!is_callable('smarty_modifier_truncate')) include '/var/www/html/magroup/SpeedPHP/Drivers/Smarty/plugins/modifier.truncate.php';
?><?php $_template = new Smarty_Internal_Template("tpl/header.html", $_smarty_tpl->smarty, $_smarty_tpl, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null);
 echo $_template->getRenderedTemplate(); $_template->rendered_content = null;?><?php unset($_template);?>

<h2 class="ytadmin-h2">链接列表
<a class="pull-right btn btn-info" href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['spUrl'][0][0]->__template_spUrl(array('c'=>'url','a'=>'opera','cat_id'=>$_smarty_tpl->getVariable('cat_id')->value),$_smarty_tpl);?>
">添加链接</a>
</h2>
<div class="clearfix ytadmin-search-box">
<form class="form-inline" role="form" action="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['spUrl'][0][0]->__template_spUrl(array('c'=>'url','a'=>'index'),$_smarty_tpl);?>
" method="post">
	<div class="form-group">
		<label class="sr-only" for="s_content">搜索内容</label>
      	<input class="form-control" type="text" id="s_content" name="s_content" value="<?php echo $_smarty_tpl->getVariable('data_return')->value['s_content'];?>
" placeholder="搜索内容"/>
    </div>
    <div class="form-group">
    	<label class="sr-only" for="s_cat_id">搜索分类</label>
      	<select name="cat_id" id="s_cat_id" class="form-control">
				<option value="0">全部分类</option>
		<?php  $_smarty_tpl->tpl_vars['cat_item'] = new Smarty_Variable;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('cat_result')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['cat_item']->key => $_smarty_tpl->tpl_vars['cat_item']->value){
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['cat_item']->key;
?>
			<?php if ($_smarty_tpl->getVariable('data_return')->value['cat_id']==$_smarty_tpl->tpl_vars['cat_item']->value['id']){?>
				<option value="<?php echo $_smarty_tpl->tpl_vars['cat_item']->value['id'];?>
" selected="selected"><?php echo $_smarty_tpl->tpl_vars['cat_item']->value['name'];?>
</option>
			<?php }else{ ?>
				<option value="<?php echo $_smarty_tpl->tpl_vars['cat_item']->value['id'];?>
"><?php echo $_smarty_tpl->tpl_vars['cat_item']->value['name'];?>
</option>
			<?php }?>
		<?php }} ?>
	  	</select>
	</div>
	<div class="form-group">
      	<input class="btn btn-info" type="submit" name="s_submit" value="搜索">
    </div>
</form>
</div>
<div class="ytadmin-table-wrap">
	<h3>
	<?php if ($_smarty_tpl->getVariable('data_return')->value['s_submit']){?>
		关于"<?php echo $_smarty_tpl->getVariable('data_return')->value['s_content'];?>
"的搜索结果
	<?php }?>
	</h3>
	<table class="table table-striped">
		<tr>
			<th>标题</th>
			<th>浏览</th>
			<th>日期</th>
			<th>排序</th>
			<th>可见性</th>
			<th>操作</th>
		</tr>
	<?php  $_smarty_tpl->tpl_vars['url_item'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('url_result')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['url_item']->key => $_smarty_tpl->tpl_vars['url_item']->value){
?>
		<tr>
			<td>
				<a target="_blank" title="预览" href="#"><?php echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['url_item']->value['title'],26,'...');?>
</a>
			</td>
			<td>
				<?php echo $_smarty_tpl->tpl_vars['url_item']->value['view_num'];?>

			</td>
			<td>
				<?php echo $_smarty_tpl->tpl_vars['url_item']->value['add_time'];?>

			</td>
			<td>		
				<form class="form-inline"  action="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['spUrl'][0][0]->__template_spUrl(array('c'=>'url','a'=>'index','cat_id'=>$_smarty_tpl->getVariable('cat_id')->value),$_smarty_tpl);?>
" method="post">		
					<div class="form-group">
						<input type="text" name="weight" class="form-control input-sm ytadmin-input-min" value="<?php echo $_smarty_tpl->tpl_vars['url_item']->value['weight'];?>
" />
					</div>
					<div class="form-group">		
						<input type="hidden" name="url_id" value="<?php echo $_smarty_tpl->tpl_vars['url_item']->value['id'];?>
"/>						
						<input type="submit" name="url_update" class="btn btn-sm" value="更新"/>
					</div>
				</form>
			</td>
			<td>
				<div class="btn-group">
					<?php if ($_smarty_tpl->tpl_vars['url_item']->value['visible']){?>
						<a class="btn btn-info btn-sm">显示</a>
						<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['spUrl'][0][0]->__template_spUrl(array('c'=>'url','a'=>'index','cat_id'=>$_smarty_tpl->getVariable('cat_id')->value,'url_id'=>$_smarty_tpl->tpl_vars['url_item']->value['id'],'url_update'=>1,'visible'=>0),$_smarty_tpl);?>
" class="btn btn-default btn-sm">隐藏</a>
					<?php }else{ ?>
						<a href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['spUrl'][0][0]->__template_spUrl(array('c'=>'url','a'=>'index','cat_id'=>$_smarty_tpl->getVariable('cat_id')->value,'url_id'=>$_smarty_tpl->tpl_vars['url_item']->value['id'],'url_update'=>1,'visible'=>1),$_smarty_tpl);?>
" class="btn btn-default btn-sm">显示</a>
						<a href="" class="btn btn-info  btn-sm">隐藏</a>
					<?php }?>
				</div>					
			</td>
			<td>
				
				<a class="btn btn-info btn-sm" title="更新" href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['spUrl'][0][0]->__template_spUrl(array('c'=>'url','a'=>'opera','update_url_id'=>$_smarty_tpl->tpl_vars['url_item']->value['id'],'cat_id'=>$_smarty_tpl->getVariable('cat_id')->value),$_smarty_tpl);?>
">更新</a>
				<a class="btn btn-warning btn-sm" title="删除" href="<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['spUrl'][0][0]->__template_spUrl(array('c'=>'url','a'=>'index','delete_url_id'=>$_smarty_tpl->tpl_vars['url_item']->value['id'],'cat_id'=>$_smarty_tpl->getVariable('cat_id')->value),$_smarty_tpl);?>
">删除</a>
			</td>
		</tr>
	<?php }} else { ?>
		<tr><td colspan="6">此分类下连一个链接也没有！</td></tr>
	<?php } ?>
	</table>
	
	<?php $_template = new Smarty_Internal_Template("tpl/pagination.html", $_smarty_tpl->smarty, $_smarty_tpl, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null);
 echo $_template->getRenderedTemplate(); $_template->rendered_content = null;?><?php unset($_template);?>
	
</div>

<?php $_template = new Smarty_Internal_Template("tpl/footer.html", $_smarty_tpl->smarty, $_smarty_tpl, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null);
 echo $_template->getRenderedTemplate(); $_template->rendered_content = null;?><?php unset($_template);?>